<template>
  <div>
    {{ homeHook.testTxt }}
  </div>
  <comCanvasRectangle @drawFinish="drawFinish" @selectRectangle="selectRectangle" />
</template>

<script setup lang="ts">
import { HomeHook } from '@/hooks/home/HomeHook'
import comCanvasRectangle from '@/components/com-canvas/com-canvas-rectangle.vue'
import { UserApi } from '@/common/api/apis/user_api'
import { ApiMediator } from '@/common/api/api_mediator'
import { getCurrentInstance } from 'vue'
const { proxy }:any = getCurrentInstance()
defineOptions({
  name: 'HomeView',
})

//region # Hooks

// 首页Hook
const homeHook = new HomeHook()

//endregion

//region # 属性

//endregion

//region # 方法

// Action

function drawFinish(shapes) {
  console.log('drawFinish', shapes)
  proxy.$api.user.getUser('');
  // let d=new ApiMediator;
  // d.user.createUser()
}

function selectRectangle(shape) {
  console.log('selectRectangle', shape)
}

// Private

//endregion
</script>

<style scoped lang="less">
@import 'HomeView.less';
</style>
